package animal;

/*
 *  user:38917
 *  date:2025/5/5
 *  time:14:44
 */

public class Dog extends Animal {
    //
    public String weight = "子类体重";
    //
    public void demo(){
        System.out.println(this.weight);
        System.out.println(this.name);
        System.out.println(this.color);
        System.out.println(this.age);
        System.out.println("====================");
        System.out.println(super.weight);
    }
    public void demo2(){
        this.sleep();
        System.out.println("====================");
        super.sleep();
    }
    public void sleep(){
        System.out.println("子类的方法");
    }
    public void bark(){
        System.out.println(super.name + " 狗叫");
    }
    //构造方法
    public Dog(String fatherName,String dogName){
        super(fatherName);
        this.name = dogName;
    }
    public Dog(){
        super();
    }
}
